package com.hyou.springboot.base;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;

import com.hyou.springboot.validator.group.PageQueryGroup;

/**
 * 支持分页查询的请求数据对象
 * 
 * @author FengChangshuo
 * @version 1.0.0 2018-11-09 10:33:25 初始创建
 */
public class BasePageForm extends BaseForm {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -3072478467649943736L;
    
    /**
     * 当前页
     */
    @Digits(groups = PageQueryGroup.class, integer = 20, fraction = 0, message = "当前页码数据格式错误")
    private String pageNum = "1";
    
    /**
     * 每页的数量
     */
    @Digits(groups = PageQueryGroup.class, integer = 20, fraction = 0, message = "每页的数量数据格式错误")
    @Max(groups = PageQueryGroup.class, value = 100, message = "每页最大允许查询100条数据")
    private String pageSize = "10";
    
    /**
     * @return 当前页
     */
    public String getPageNum() {
        return this.pageNum;
    }

    /**
     * @param pageNum 当前页
     */
    public void setPageNum(String pageNum) {
        this.pageNum = pageNum;
    }

    /**
     * @return 每页的数量
     */
    public String getPageSize() {
        return this.pageSize;
    }

    /**
     * @param pageSize 每页的数量
     */
    public void setPageSize(String pageSize) {
        this.pageSize = pageSize;
    }
}
